package cn.itcast.nems.enrol.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.math.BigDecimal;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class EnrolDiscountDTO implements Serializable,Comparable<EnrolDiscountDTO> {
    private Long id;
    private Long discountId ;
    private String discountName ;
    private BigDecimal discountMoney ;
    // 优惠单行ID, 可为null, 个人优惠单时必填
    private String journalDiscountLineId;
    private Byte sort ;

    public EnrolDiscountDTO(Long id, Long discountId, String discountName, BigDecimal discountMoney, Byte sort) {
        this.id = id;
        this.discountId = discountId;
        this.discountName = discountName;
        this.discountMoney = discountMoney;
        this.sort = sort;
    }

    @Override
    public int compareTo(EnrolDiscountDTO o) {
        return this.getSort().compareTo(o.getSort());
    }
}
